home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 526-550 / disk_539 / simplerexx / simplerexx.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  114 lines

  1. /*
  2.  * Simple ARexx interface by Michael Sinz
  3.  *
  4.  * This is a very "Simple" interface...
  5.  */
  6.  
  7. #ifndef    SIMPLE_REXX_H
  8. #define    SIMPLE_REXX_H
  9.  
  10. #include    <exec/types.h>
  11. #include    <exec/nodes.h>
  12. #include    <exec/lists.h>
  13. #include    <exec/ports.h>
  14.  
  15. #include    <rexx/storage.h>
  16. #include    <rexx/rxslib.h>
  17.  
  18. /*
  19.  * This is the handle that SimpleRexx will give you
  20.  * when you initialize an ARexx port...
  21.  *
  22.  * The conditional below is used to skip this if we have
  23.  * defined it earlier...
  24.  */
  25. #ifndef    AREXXCONTEXT
  26.  
  27. typedef void *AREXXCONTEXT;
  28.  
  29. #endif    /* AREXXCONTEXT */
  30.  
  31. /*
  32.  * The value of RexxMsg (from GetARexxMsg) if there was an error returned
  33.  */
  34. #define    REXX_RETURN_ERROR    ((struct RexxMsg *)-1L)
  35.  
  36. /*
  37.  * This function closes down the ARexx context that was opened
  38.  * with InitARexx...
  39.  */
  40. void FreeARexx(AREXXCONTEXT);
  41.  
  42. /*
  43.  * This routine initializes an ARexx port for your process
  44.  * This should only be done once per process.  You must call it
  45.  * with a valid application name and you must use the handle it
  46.  * returns in all other calls...
  47.  *
  48.  * NOTE:  The AppName should not have spaces in it...
  49.  *        Example AppNames:  "MyWord" or "FastCalc" etc...
  50.  *        The name *MUST* be less that 16 characters...
  51.  *        If it is not, it will be trimmed...
  52.  *        The name will also be UPPER-CASED...
  53.  *
  54.  * NOTE:  The Default file name extension, if NULL will be
  55.  *        "rexx"  (the "." is automatic)
  56.  */
  57. AREXXCONTEXT InitARexx(char *,char *);
  58.  
  59. /*
  60.  * This function returns the port name of your ARexx port.
  61.  * It will return NULL if there is no ARexx port...
  62.  *
  63.  * This string is *READ ONLY*  You *MUST NOT* modify it...
  64.  */
  65. char *ARexxName(AREXXCONTEXT);
  66.  
  67. /*
  68.  * This function returns the signal mask that the Rexx port is
  69.  * using.  It returns NULL if there is no signal...
  70.  *
  71.  * Use this signal bit in your Wait() loop...
  72.  */
  73. ULONG ARexxSignal(AREXXCONTEXT);
  74.  
  75. /*
  76.  * This function returns a structure that contains the commands sent from
  77.  * ARexx...  You will need to parse it and return the structure back
  78.  * so that the memory can be freed...
  79.  *
  80.  * This returns NULL if there was no message...
  81.  */
  82. struct RexxMsg *GetARexxMsg(AREXXCONTEXT);
  83.  
  84. /*
  85.  * Use this to return a ARexx message...
  86.  *
  87.  * If you wish to return something, it must be in the RString.
  88.  * If you wish to return an Error, it must be in the Error.
  89.  */
  90. void ReplyARexxMsg(AREXXCONTEXT,struct RexxMsg *,char *,LONG);
  91.  
  92. /*
  93.  * This function will send a string to ARexx...
  94.  *
  95.  * The default host port will be that of your task...
  96.  *
  97.  * If you set StringFile to TRUE, it will set that bit for the message...
  98.  *
  99.  * Returns TRUE if it send the message, FALSE if it did not...
  100.  */
  101. short SendARexxMsg(AREXXCONTEXT,char *,short);
  102.  
  103. /*
  104.  * This function will set an error string for the ARexx
  105.  * application in the variable defined as <appname>.LASTERROR
  106.  *
  107.  * Note that this can only happen if there is an ARexx message...
  108.  *
  109.  * This returns TRUE if it worked, FALSE if it did not...
  110.  */
  111. short SetARexxLastError(AREXXCONTEXT,struct RexxMsg *,char *);
  112.  
  113. #endif    /* SIMPLE_REXX_H */
  114.